#include <bits/stdc++.h>
using namespace std;
int n,a[100005],cnt1[100005],cnt2[100005],ans;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
        cnt1[a[i]]++;
        cnt2[a[i]]++;
    }
    ans=n;
    sort(a+1,a+1+n);
    int len=unique(a+1,a+1+n)-a-1,last=1;
    for(int i=2;i<=len;i++){
        int j=last;
        while(cnt1[a[i]]>=cnt2[a[j]]&&j<i){
            cnt1[a[i]]-=cnt2[a[j]];
            ans-=cnt2[a[j]];
            cnt2[a[j]]=0;
            j++;
            last=j;
        }
        if(j==i){
            continue;
        }
        cnt2[a[j]]-=cnt1[a[i]];
        ans-=cnt1[a[i]];
        cnt1[a[i]]=0;
    }
    printf("%d",ans);

    return 0;
}
